package com.dongdongshop.config;


import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000121661713";



    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key ="MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC3MqBGlEep6xkBHC/qBQP4PnC87fp1BrTvrmUxXEcpt3DL7Mitti7T1aTzi75Xha3/vMh3bwhPalHexB6lpKvFD3x2BktsGyVxEFERqpAPSRWXf2kDrM4APwK7fYaHD6CI9DP4Lx+jPsFSURXYyvUJaa1qVtdX3G6/rq1mwMUtT4CQAtv6VImfGozhCpP78Qbc4G91DawjLxUTgYH/yspinFO/AF/5OMNtwGPWWUdbS7i/miLleNRYK0EXKSnej59zEoQrb1YxPFp/Q6wNfYzRSjsQvDJ6IfbvOT+DofLgxmYEKSJ5a+hsMaTCdd1ht/bjVPhkOFII2kFWfGgg6bJ9AgMBAAECggEAXSNA9wEV+h5LZRQWjAymuwPLv1HiHrMdNCneypyWlW/sydCFKkPQROR+a0+losuU7crlxErP18g+/VmKFz7EEXjRFxQWLk0S2Qupm6iyewL2FkKxeivVw6xFUFr+FRZt0JMPBOO4Wv9hu977k2+D6pgukTy7WLD6ITvGbtIcrO67dqF6xeh9zmbY0WtUDOhY7nEbFgff01YkVQ36119sKWpC0/W7RlTVLJkARZ0CCfsJogq/RwcDjf5cmljRb6eWk7ZnMDi+014fK5gLytjs09BXT3OB5xAmKC8C68HzwsPJ+qN/O/XNneiKrmFoClM0n9R0JX7TXwvxyPEu7SXx5QKBgQD2EYV9EQnM/nUGNhZsCiJami2NwEiVMg6z+Czz2zRO9vGfoDB9Uo24TkC3wUxMJRqv6reGa7FXZsBJzbh0mlbRAkKXvQQWITCBBRoV26mE2pepuMYorJb4KPJWgCFgUzKbUp87DTrZPhGidJqUh63hV4sq3Xy9H4p3BNRRbIe/IwKBgQC+l3/TiH7ituhkY/loZeI0gKQqAUXY930O0SssfESFLAPb2VnGm0PqDQDv5eVoQsqkXyyPgg1LSSlsPJcuFyq0rR5c+LgLZIwz4ZID49ZSv0yzmOzBD4jRs6LRLJX5Y3f1BnVl8qBJOtEO+2/mRPFn4UuQ+3UsRAig+9GoCCGx3wKBgGUuJzmZ+/Gy3+PB8c5TDHU82GZlHnNatfkCn1lWVVfy6r+8WrPtciDK7ImijgDxcNvNI9G+DpnlwkOWt7YakIA48bD7I+cFlrA2rNc4D6h1Sc+cDr9C2IEKNTukTBUToMeFXbwmYIBbqVynnbhdYf46xRrHIDeT9JekALnKarcJAoGAKRhbjI3q5hGQTE0uMu989dsjCpeZqu26Pl6lk4L790cFUfssm2FRJH9HS3LjozZ7oTOQVSUynqAY2Wi7JEoEgE6vtFZAwNweSvWBWWtgBBmRfUwlCH/D/YthOP8HG23yKJgK6j+FhiSzfSqD9z+4WbC/bXR60F+fCK8jhrqyITsCgYAMcRgTHIKk8bwBsSb0ngPle8YQd3kexNOFKekJ4qPTY4ltR1AH2Xdyfo+MQJ4kAnQCk+CqAziAImJTX2ou36kDT25t0HyhsY1l+E2eUXYZ7LQvDa8+bD3YBQmkAEZEwFiV2hIbhoggFy4fyvY/U1SWVDIrLhecO2haaVK7d9hb9g==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key ="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyOWaA/NMD1krAIo/JRE234m0Zu9gy4yoe/90QYJ/VeqYHG0a+iYZ4Z9dhGy/2MILtjyMracOkol0l2JvXoP1oWIcXLs2ZM8jUqQjcRsyAHMGyhnNVM8vfCzNxiBvot1DX7RZPZbgodLf6+yDBbCwxBXmsGPG8eFiPVYKpQtU/qt5V8tOBfgtjm4aHAgpKdsB0FXT25hFBTRVEiWDWyqXM1q+utClvsCNB2M9Tqu9lnbf6lUjH6oYM/ECY/u+g6ylJYIEFq2aAzjcVD7pLgA6GcieHUHWfdX8ermtrRK54NJ+Vo4Z/z8L8OEdIazzEoKXqf9bGm3IBBVUuiB5BhDuewIDAQAB";


    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "https://59a25v3539.oicp.vip/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "https://59a25v3539.oicp.vip/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
